<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
 <%@ include file="/commons/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="no-cache">
<meta http-equiv="Expires" content="-1">
<meta http-equiv="Cache-Control" content="no-cache">
<title>发布名家资料</title>
<link href="../style/css_member.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../js/common.js"></script>
<script src="../js/artDialog.js?skin=gray"></script>
<script src="../js/artDialog.iframeTools.js"></script>
<script type="text/javascript" src="../js/jquery-1.3.2.js"></script>
<script type="text/javascript">

$(function(){
	$("#painterLink").click(function(){
		art.dialog.open('${ctx}/fileUpload!uploadPrepare.do?imgType=painter&sharpId=6',{title:'上传艺术家照片',width:800,height:550,lock:true},false);
    });
    
	$("a[name='addPaintingHref']").click(function(){
		alert("请先保存名家资料");
		return false;
    });

	m2('m1_007','m1_007_01');
});

	/**********提交前检查表单*****************/
	function checkForm(){

		var name = $.trim($("#name").val());
		if( name  ==  ""){
			$("#name").focus();
			 alert("艺术家姓名不能为空。");
			 return false;
		}

		var picImage = $("#picImage").val();
		if( picImage == "" ){
			alert("请上传艺术家照片");
			return false;
		}

		var age = $("#age").val();
		if(age == ""){
			$("#age").val("");
			$("#age").focus();
			alert("请输入合法的出生年份");
			return false;
		}

		var province = $("#provinceInfoSelect").val();
		var city = $("#cityInfoSelect").val();
		var address =  $.trim($("#address").val());
		if(province == "" && address == ""){
			alert("请填写名家的籍贯");
			return false;
		}

		var achievement1 = $("#achievement1").val();
		if(achievement1 == ""){
			alert("请填写艺术家艺术成就。");
			return false;
		}
		
		if(window.confirm("确认提交？")){
			$("#painterForm").submit();
		}
	}

</script>
</head>

<body>

<!-- 页面头部  -->
<jsp:include page="/commons/head_member.jsp"></jsp:include>

<form action="${ctx }/painter/saveAddition.do" method="post" id="painterForm" name="painterForm">
<table width="960" border="0" cellspacing="0" cellpadding="0" align="center"  class="tbl_border_top">
    <tr>
      <td colspan="3" class="bt14A" align="center">填写名家资料</td>
    </tr>
    <tr>
       <td class="bt14A" align="right"><span class="style15">*</span> 艺术家姓名：</td>
       <td class="bt14A"><input name="painter.name" type="text" size="20" id="name" maxlength="40"></td>
       <td></td>
    </tr>
    <tr>
      <td class="bt14A" align="right"><span class="style15">*</span> 选择年代：</td>
      <td class="bt14A">
        	<select name="painter.decade">
           <option value="1">近现代国画名家</option>
           <option value="2">近现代油画名家</option>
           <option value="3">当代国画名家</option>
           <option value="4">当代油画名家</option>
           <option value="5">古代国画名家</option>
           <option value="6">国外名家</option>
          </select>
      </td>
      <td width="160" rowspan="10" valign="top" class="bt14A" align="left">
          <table width="150" height="184" border="0" cellpadding="0" cellspacing="1" bordercolor="#CCCCCC" bgcolor="#CCCCCC">
            <tr>
              <td bgcolor="#FFFFFF">
              	<div id="photoTd" style="width: 150px;height: 184px;vertical-align: middle;text-align: center;overflow: hidden;"></div>
              </td>
            </tr>
          </table>
      </td>
    </tr>
    <tr>
       <td></td>
       <td class="bt14A">
       		字<input name="painter.zi" type="text" size="6" maxlength="15">
       		号<input name="painter.hao" type="text" size="6" maxlength="15">
       </td>
        <td></td>
    </tr>
    <tr>
      <td class="bt14A" align="right"><span class="style15">*</span>艺术家照片：</td>
      <td class="bt14A"><span class="style18"><a id="painterLink" style="cursor: pointer;color: red">上传</a></span></td>
      <td></td>
    </tr>
    <tr>
      <td class="bt14A" align="right"><span class="style15">*</span> 年 龄：</td>
      <td class="bt14A"><input name="painter.age" type="text" size="3" id="age" maxlength="4">年生
        <input name="painter.endAge" type="text" size="3" id="endAge" maxlength="4">年逝
  	  </td>
  	   <td></td>
    </tr>
    <tr>
      <td class="bt14A" align="right"><span class="style15">* </span>籍贯：</td>
      <td class="bt14A">
        		<select name="painter.provinceInfo.id" id="provinceInfoSelect" onchange="changeProvince()">
		              <option value="">选择省份</option>
		              <c:forEach items="${provinceInfoList}" var="provinceInfo" varStatus="status">
		      				<option value="${ provinceInfo.id}"/> ${ provinceInfo.name}</option>
		  			 </c:forEach>
              </select>
              <select name="painter.cityInfo.id" id="cityInfoSelect">
                	<option value="">选择县市</option>
              </select>
              <input name="painter.address" type="text" size="40" id="address">
         </td>
          <td></td>
        </tr>
        <tr>
          <td class="bt14A" align="right">毕业院校：</td>
          <td class="bt14A"><input name="painter.graduatedFrom" type="text" size="30" id="graduatedFrom" maxlength="50"></td>
           <td></td>
       </tr>
        <tr>
          <td class="bt14A" align="right">职业/头衔：</td>
          <td class="bt14A"><input name="painter.honour" type="text" size="40" id="honour" maxlength="100"></td>
           <td></td>
        </tr>
       <%@include file="/commons/painter_star_market_fragment.jsp" %>
        <tr>
          <td class="bt14A" align="right"><span class="style15">*</span> 艺术人生：</td>
          <td class="bt14A" colspan="2"><textarea rows="8" cols="80" name="painter.description"  id="achievement1"></textarea></td>
       </tr>
       <tr>
         <td width="180"> 
	         	<!-- 隐藏域 begin -->
				     <input name="painter.imageInfo.id" type="hidden"  id="picImage">
				     <input name="painter.type" type="hidden" id="painter_type" value="2">
				<!-- 隐藏域 end --> 
	    </td>
         <td class="nw12a" colspan="2"><img src="../images/an24.gif" width="114" height="31" onClick="javascript:checkForm()" style="cursor: pointer ;border: 0"></td>
     </tr>
</table>
</form>

<%@ include file="/member/list_painting_fragment.jsp" %>

<jsp:include page="/commons/foot_member.jsp"></jsp:include>

</body>
</html>